package top.jle.wx.proxy.feign.menu;

import com.alibaba.fastjson2.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(url = "https://api.weixin.qq.com",name="menu")
public interface MenuAPIFeign {

    /**
     * 创建自定义菜单接口
     * @param accessToken
     * @param menus
     * @return
     */
    @PostMapping(value = "/cgi-bin/menu/create",consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject createMenu(@RequestBody JSONObject menus);

    /**
     * 查询自定义菜单接口
     * @param accessToken
     * @return
     */
    @GetMapping("/cgi-bin/menu/get")
    JSONObject getMenus();


    /**
     * 创建个性化自定义菜单
     * @param accessToken
     * @return
     */
    @PostMapping(value = "/cgi-bin/menu/addconditional",consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject addConditionalMenus(@RequestBody JSONObject menus);

    /**
     * 根据menuid删除个性化菜单
     * @param accessToken
     * @param menuId
     * @return
     */
    @PostMapping(value = "/cgi-bin/menu/delconditional",consumes = MediaType.APPLICATION_JSON_VALUE)
    JSONObject deleteConditionalMenus(@RequestBody JSONObject menuId);
}
